package com.tianyu.model.entity;

import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.util.Date;

/**********************************
 * @Author YSW
 * @Description
 * @Date 2024/6/12 - 14:45
 **********************************/

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@TableName(autoResultMap = true)
public class ThirdCompanyAccessChannel {


    @TableId
    private Integer id;

    @TableField(typeHandler = JacksonTypeHandler.class)
    private JSONObject accessChannel;

    private String thirdId;

    private String remark;

    private Integer ykCompanyId;

    private Date createTime;

    private Date modifyTime;

    public void setAccessChannel(JSONObject accessChannel) {
        this.accessChannel = accessChannel;
        final Integer accessType = accessChannel.getInteger("accessType");
//        System.out.println(accessType);
    }

    public static class AccessChannel01 {
        private Integer accessType;
        private String rsaPublic;
        private String rsaPrivate;
    }
}
